E ectively Exploiting Indirect Jumps

نویسندگان

  • DAVID B. WHALLEY
  • David Whalley
چکیده

This paper describes a general code-improving transformation that can coalesce conditional branches into an indirect jump from a table. Applying this transformation allows an optimizer to exploit indirect jumps for many other coalescing opportunities besides the translation of multiway branch statements. First, dataaow analysis is performed to detect a set of coalescent conditional branches, which are often separated by blocks of intervening instructions. Second, several techniques are applied to reduce the cost of performing an indirect jump operation, often requiring the execution of only two instructions on a SPARC. Finally, the control ow is restructured using code duplication to replace the set of branches with an indirect jump. Thus, the transformation essentially provides early resolution of conditional branches that may originally have been some distance from the point where the indirect jump is inserted. The transformation can be frequently applied with often signiicant reductions in the number of instructions executed, total cache work, and execution time. In addition, we show that with branch target buuer support, indirect jumps improve branch prediction since they cause fewer mispredictions than the set of branches they replaced. 1. INTRODUCTION Most high-level languages provide multiway branch statements to allow programmers to write more readable code. The characteristic feature of a multiway statement is the ability to select an action based on the value of a control expression. Without performing any optimization, a compiler would translate each case label of the multiway statement into a conditional branch. Because of the widespread usage of multiway statements, instruction sets commonly support an indirect jump from a table in order to reduce the cost of such sequences of conditional branches. As a result, compiler front-ends typically generate an indirect jump from a table as one translation alternative 1 for multiway statements Sale 1981; Spuler 1994]. This traditional approach for using indirect jumps poses two problems. First, it is diicult to determine when the indirect jump can be eeectively used in a machine-independent fashion since an accurate cost-beneet estimate can only be made after generating machine code. Second, many code-improving opportunities

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Effectively Exploiting Indirect Jumps

This dissertation describes a general code-improving transformation that can coalesce conditional branches into an indirect jump from a table. Applying this transformation allows an optimizer to exploit indirect jumps for many other coalescing opportunities besides the translation of multiway branch statements. First, data ow analysis is performed to detect a set of coalescent conditional branc...

متن کامل

Coalescing Conditional Branches into Efficient Indirect Jumps

Indirect jumps from tables are traditionally only generated by compilers as an intermediate code generation decision when translating multiway selection statements. However, making this decision during intermediate code generation poses problems. The research described in this paper resolves these problems by using several types of static analysis as a framework for a code improving transformat...

متن کامل

Short Positions, Rally Fears and Option Markets

Index option pricing on world market indices are investigated using Lévy processes with no positive jumps. Economically this is motivated by the possible absence of longer horizon short positions while mathematically we are able to evaluate for such processes the probability of a Rally Before a Crash (RBC). Three models are used to e¤ectively calibrate index options at an annual maturity and it...

متن کامل

Register Indirect Jump Target Forwarding

Object-oriented languages have recently become common, making register indirect jumps more important than ever. In objectoriented languages, virtual functions are heavily used because they improve programming productivity greatly. Virtual function calls usually consist of register indirect jumps, and consequently, programs written in objectoriented languages contain many register indirect jumps...

متن کامل

Optimal Planning with a Goal-directed Utility Model

Classical AI planning adopts a very narrow notion of plan quality, namely that a plan is good just in case it achieves a speci ed goal. Despite the fact that planning is intractable in the worst case, goal-satisfying planning algorithms can e ectively solve classes of problems by using the goal to focus the search for a solution (by using backward-chaining techniques), and by exploiting domain-...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1999